package cn.rkylin.oms.sysreturn.dao;

import java.util.List;

import cn.rkylin.oms.sysreturn.domain.SysReturn;
import cn.rkylin.oms.sysreturn.vo.SysReturnVO;

public interface ISysReturnDAO {
    int deleteByPrimaryKey(String returnId);

    int insert(SysReturn record);

    int insertSelective(SysReturn record) throws Exception;

    SysReturn selectByPrimaryKey(String returnId);

    int updateByPrimaryKeySelective(SysReturn record);

    int updateByPrimaryKey(SysReturn record);

    /**
     * updateBySelective:局部更新退货单. <br/>
     * 如果operable为y，则添加“可操作”作为查询条件.<br/>
     *
     * @author zhanghao
     * @param record
     * @return
     * @throws Exception 
     */
    int updateBySelective(SysReturnVO record) throws Exception;

    /**
     * selectBySelectiveValue:条件查询退货单. <br/>
     *
     * @author zhanghao
     * @param sysReturnVO
     * @return 
     * @throws Exception 
     */
    List<SysReturn> selectBySelectiveValue(SysReturnVO sysReturnVO) throws Exception;

    /**
     * cancelSysReturn4Ext:作废三方仓退货单. <br/>
     *
     * @author zhanghao
     * @param param
     * @return
     * @throws Exception 
     */
    int cancelSysReturn4Ext(SysReturnVO param) throws Exception;

    /**
     * cancelSysReturn4Local:作废本地仓退货单. <br/>
     *
     * @author zhanghao
     * @param param
     * @return
     * @throws Exception 
     */
    int cancelSysReturn4Local(SysReturnVO param) throws Exception;

    /**
     * updateUnApproveSysReturn:将符合条件的退货单设置为未审核. <br/>
     *
     * @author zhanghao
     * @param param
     * @return
     * @throws Exception 
     */
    int updateUnApproveSysReturn(SysReturnVO param) throws Exception;

    /**
     * selectBySelectiveValueExtend:条件查询退货单. <br/>
     *
     * @author zhanghao
     * @param queryParam
     * @return
     * @throws Exception 
     */
    List<SysReturnVO> selectBySelectiveValueExtend(SysReturnVO queryParam) throws Exception;

    /**
     * selectByRefundId:条件查询退货单. <br/>
     *
     * @author zhanghao
     * @param refundId 退款单ID
     * @return
     * @throws Exception
     */
    List<SysReturnVO> selectByRefundId(String refundId) throws Exception;

    /**
     * 通过来源ID获取系统退货单
     * @param sourceId
     * @return
     * @throws Exception
     */
    public List<SysReturn> selectSysReturnForSysOrder(String sourceId) throws Exception;

}